package com.lyh.yobeiapplication.server;

import org.json.JSONObject;

public class BasicResult {

    public static final String KEY_STATUS = "status";
    public static final String KEY_MSG = "msg";
    public static final String KEY_DATA = "data";

    /** 返回状态标示   */
    public int status = -1;

    /** 提示信息   */
    public String msg;
    
    /** 数据   */
    public String data;


    public BasicResult(JSONObject object) {
        if (object != null) {
            String code = object.optString(KEY_STATUS);
            try {
                status = Integer.valueOf(code);
            } catch (NumberFormatException e) {
                // TODO NumberFormatException
            }

            msg = object.optString(KEY_MSG);
            data = object.optString(KEY_DATA);
        }
    }

    public BasicResult() {
    }
}
